import styled from 'styled-components'

export const PlayerWrapper = styled.div`
  height: 53px;
  position: fixed;
  left: 0;
  bottom: 0;
  right: 0;
  z-index: 99;
  /* background-color: red; */

  .player_bg {
    height: 53px;
    margin-right: 67px;
    background-position: 0 0;
    background-repeat: repeat-x;
  }
  .right_icon {
    .left {
      position: absolute;
      top: -14px;
      right: 15px;
      width: 52px;
      height: 67px;
      background-position: 0 -380px;
    }
    .right {
      position: absolute;
      top: -1px;
      right: 0;
      width: 15px;
      height: 54px;
      background-position: -52px -393px;
      pointer-events: none;
    }
  }
`

export const PlayerContentWrapper = styled.div`
  position: absolute;
  left: 50%;
  top: 6px;
  z-index: 15;
  width: 1030px;
  height: 47px;
  margin: 0 auto;
  margin-left: -490px;
  display: flex;
`
interface IBarControl {
  $isplaying: any
}

export const LeftWrapper = styled.div<IBarControl>`
  width: 137px;
  padding: 6px 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;

  .btn {
    margin-right: 8px;
    cursor: pointer;
  }
  .prev {
    width: 28px;
    height: 28px;
    background-position: 0 -130px;
    &:hover {
      background-position: -30px -130px;
    }
  }
  .play {
    width: 36px;
    height: 36px;
    background-position: 0 ${(props) => (props.$isplaying ? '-165px' : '-204px')};
    &:hover {
      background-position: ${(props) =>
        props.$isplaying ? '-40px -165px' : '-40px -204px'};
    }
  }
  .next {
    width: 28px;
    height: 28px;
    background-position: -80px -130px;
    &:hover {
      background-position: -110px -130px;
    }
  }
`

export const Right1Wrapper = styled.div`
  width: 87px;
  display: flex;
  align-items: center;
  justify-content: center;

  .btn {
    width: 25px;
    height: 25px;
    cursor: pointer;
  }
  .pip {
    &:hover {
      background-position-y: -25px;
    }
  }
  .favor {
    background-position: -88px -163px;
    &:hover {
      background-position: -88px -189px;
    }
  }
  .share {
    background-position: -114px -163px;
    &:hover {
      background-position: -114px -189px;
    }
  }
`

export const Right2Wrapper = styled.div`
  width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  .btn {
    width: 25px;
    height: 25px;
  }
  .voice {
    background-position: -2px -248px;
    &:hover {
      background-position: -31px -248px;
    }
  }
  .mode {
    background-position: -3px -344px;
    &:hover {
      background-position: -33px -344px;
    }
  }
  .audio_list {
    position: relative;
    display: flex;
    .icon {
      width: 60px;
      height: 25px;
      background-position: -42px -68px;
    }
    .text {
      color: #666;
      position: absolute;
      right: 17px;
      top: 8px;
    }
  }
  .quality_audio {
    width: 41px;
    height: 30px;
    background-size: 45px 30px;
  }
`

export const ContentWrapper = styled.div`
  flex: 1;
  display: flex;
  align-items: center;

  .poster {
    width: 34px;
    height: 34px;
    position: relative;
    margin-left: 20px;
    margin-right: 20px;
    background-color: red;

    .image {
      width: inherit;
      height: inherit;
    }

    .poster_mask {
      position: absolute;
      top: 0px;
      left: 0px;
      display: block;
      width: 34px;
      height: 35px;
      background-position: 0 -80px;
    }
  }

  .progress {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;

    .songinfo {
      height: 28px;
      overflow: hidden;
      color: #e8e8e8;
      line-height: 28px;
      text-shadow: 0 1px 0 #171717;

      a {
        cursor: pointer;
      }
      a:hover {
        text-decoration: underline;
      }
      .songname {
        max-width: 300px;
      }
      .artname {
        margin-left: 30px;
      }
    }

    .ant-slider {
      position: relative;
      top: -3px;
      width: 493px;
      margin-right: 10px;
      margin-top: 0;

      .ant-slider-rail {
        height: 9px;
        background: url(${require('@/assets/img/progress_bar.png')}) right 0;
      }

      .ant-slider-track {
        height: 9px;
        background: url(${require('@/assets/img/progress_bar.png')}) left -66px;
      }

      .ant-slider-handle {
        width: 22px;
        height: 24px;
        border: none;
        margin-top: -5px;
        background: url(${require('@/assets/img/sprite_icon.png')}) 0 -250px;
        &::before {
          content: '';
          display: none;
        }
        &::after {
          content: '';
          display: none;
        }
      }
    }
  }

  .time {
    .current {
      color: #a1a1a1;
    }
    .divider {
      color: #797979;
      margin: 0 3px;
    }
    .duration {
      color: #797979;
    }
  }
`
